import { reactive, onMounted, onBeforeUnmount } from "vue";
export type mousePositionType = {
    x: number,
    y: number
}
export default () => {
    const mousePosition: mousePositionType = reactive({ x: 0, y: 0 });
    const clickWindow = (event: MouseEvent) => {
        mousePosition.x = event.pageX;
        mousePosition.y = event.pageY;
    };
    onMounted(() => {
        window.addEventListener("click", clickWindow);
    });
    onBeforeUnmount(() => {
        window.removeEventListener("click", clickWindow);
    });
    return mousePosition
}